package com.zoke.daycarpool.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

import com.zoke.daycarpool.fragment.MainFragment;
import com.zoke.daycarpool.fragment.MineFragment;
import com.zoke.support.base.BaseFragmentPagerAdapter;

/**
 * 首页适配器
 * 
 * @author jack
 * 
 */
public class MainTabAdapter extends BaseFragmentPagerAdapter {

	public MainTabAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	protected int getTabsCounts() {
		return 2;
	}

	@Override
	protected Fragment getFragment(int position) {
		if (position == 0)
			return new MainFragment();
		if (position == 1)
			return new MineFragment();
		// 没有则返回null
		return null;
	}

}
